package com.cwj.user.Listener;

import lombok.Getter;
import org.springframework.boot.web.context.WebServerInitializedEvent;
import org.springframework.context.ApplicationListener;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;
import javax.servlet.ServletContext;

@Component
@Getter
public class Beans implements ApplicationListener<WebServerInitializedEvent> {
    @Resource
    private ServletContext servletContext;
    private String serverPath;
    @Override
    public void onApplicationEvent(WebServerInitializedEvent web) {
        serverPath=servletContext.getRealPath("");
    }
}
